package com.newtouch.avmarketing;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

import javax.servlet.MultipartConfigElement;


@ComponentScan(basePackages = {"com.newtouch.avmarketing.*"})
@EnableMongoRepositories
@SpringBootApplication
public class AuxApplication {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(AuxApplication.class);
        springApplication.setBannerMode(Banner.Mode.OFF);
        springApplication.run(AuxApplication.class, args);
    }

    /**
     * 文件上传临时路径
     */
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setLocation("e://temp");
        return factory.createMultipartConfig();
    }
}
